home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 272 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: news.atml.co.uk!jrr
  2. From: jrr@atml.co.uk (John Rickard)
  3. Newsgroups: comp.std.c
  4. Subject: Re: size_t
  5. Date: 1 Feb 1996 20:00:22 GMT
  6. Organization: Advanced Telecommunications Modules Ltd, Cambridge, UK.
  7. Message-ID: <4er64m$pnv@gatekeeper.atml.co.uk>
  8. References: <4eiua2$9u@engnews1.Eng.Sun.COM>
  9. NNTP-Posting-Host: marlin.atml.co.uk
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Steve Clamage (clamage@Eng.Sun.COM) wrote:
  13.  
  14. : I have always thought that type size_t must be defined as one of
  15. : the standard unsigned integer types: unsigned [char | short | int | long].
  16. : I don't find wording in the ISO standard requiring that, however.
  17. : Sections 7.1.6 and 6.3.4 say it is an "unsigned integral type", a term
  18. : I don't find defined. "Integer type" is defined, but not "integral type".
  19.  
  20. 6.1.2.5 says "The type char, the signed and unsigned integer types,
  21. and the enumerated types are collectively called integral types".
  22.  
  23. I can't find a definition of "unsigned integral type".  These must
  24. certainly include the unsigned integer types; probably also char if
  25. values stored in a char object are treated as nonnegative integers,
  26. and enumerated types that are compatible with unsigned integer types.
  27.  
  28. Remembering that 6.5.2.2 says "Each enumerated type shall be
  29. compatible with an integer type", I don't see any way of detecting
  30. that size_t is not an unsigned integer type, even if it is in fact
  31. char or an enumerated type.
  32.  
  33. 6.3.3.4 says that the result of the sizeof operator (which is of type
  34. size_t) is "an integer constant".  However, this does not make sense
  35. in relation to the definition in 6.1.3.2, which defines an integer
  36. constant to be something like 123 or 0x12a4L -- a sequence of digits
  37. and letters of any of certain permitted formats.
  38.  
  39. -- 
  40. John Rickard
  41.